Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPV6 Unknown host error #99

Closed
wants to merge 2 commits into from
Closed

Conversation

SobhitaMercy
Copy link

Fixed IPV6 address association failures in requestAssociationTCP() function of dulfsm.cc.
Reference https://forum.dcmtk.org/viewtopic.php?t=5373

The issue was due to getaddrinfo() not checking IPV6 addresses for DNS lookup, resulting in an ‘Attempt to connect to unknown host’ error. Additionally, corrected sscanf formatting issue for calledPresentationAddress when an IP6 address is passed.

@eichelberg
Copy link
Member

eichelberg commented Jul 28, 2024

I have addressed some portability issues in this PR and committed the result to DCMTK's testing branch today. Once it passes our nightly builds, the commit should become visible in the public Git repository in a few days. Thank you for your contribution.

@eichelberg eichelberg closed this Jul 28, 2024
@eichelberg eichelberg reopened this Jul 29, 2024
@eichelberg
Copy link
Member

I have to reopen the pull request since the modification in OFStandard::getAddressByHostname() causes problems on some of our test platforms. Specifically, it can happen that a hostname such as "localhost" gets resolved to an IPv6 address. If the DICOM association acceptor on that host only supports IPv4 (as all DCMTK applications currently do), they cannot be reached anymore. Therefore, a more flexible mechanism that allows a client to select between IPv4, IPv6 or the automatic hostname resolution is required.

@eichelberg
Copy link
Member

I now have implemented a solution based on your PR that does not break backward compatibility. There is now a new function
ASC_setProtocolFamily() that allows the application to select the protocol family before an outgoing connection is requested. There are three possible values, corresponding to IPv4, IPv6 and automatic selection based on a DNS lookup (AF_UNSPEC). This will appear in a couple of days in our public git repository.

@eichelberg eichelberg closed this Aug 1, 2024
michaelonken pushed a commit that referenced this pull request Aug 2, 2024
Minor change to OFStandard::getAddressByHostname() and requestAssociationTCP()
that allow DCMTK based clients to connect to IPv6 based servers.

Thanks to Sobhita Mercy <[email protected]> for this contribution.
This closes GitHub pull request #99.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants